<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\controller;

/**
 * 员工控制器
 */
class Waiter extends AdminBase
{
    
    /**
     * 员工列表
     */
    public function waiterList()
    {
        $where = $this->logicWaiter->getWhere($this->param);
        $this->assign('list', $this->logicWaiter->getWaiterList($where, 'w.*', 'w.create_time desc'));
        
        return $this->fetch('waiter_list');
    }
    
    /**
     * 员工添加
     */
    public function waiterAdd()
    {
        
        IS_POST && $this->jump($this->logicWaiter->waiterEdit($this->param));
        
        return $this->fetch('waiter_edit');
    }
    
    /**
     * 员工编辑
     */
    public function waiterEdit()
    {
        
        IS_POST && $this->jump($this->logicWaiter->waiterEdit($this->param));
        
        $info = $this->logicWaiter->getWaiterInfo(['id' => $this->param['id']]);
        
        $this->assign('info', $info);
        
        return $this->fetch('waiter_edit');
    }
    
    /**
     * 员工删除
     */
    public function waiterDel($id = 0)
    {
        
        $this->jump($this->logicWaiter->waiterDel(['id' => $id]));
    }
    /**
     * 数据状态设置
     */
    public function setStatus()
    {
        
        $this->jump($this->logicAdminBase->setStatus('Waiter', $this->param));
    }
}
